<div id="content">
    <div class="row s_page_title">
        <sa-big-breadcrumbs [items]="['运维管理[环卫]','在线统计']" icon="fa fa-newspaper-o" class="col-xs-12 col-sm-7 col-md-7 col-lg-4"></sa-big-breadcrumbs>
    </div>
    <sa-widgets-grid>
        <div class="s_table">
            <div sa-widget [editbutton]="false" color="darken" class="clearfix">
                <header><span class="widget-icon"> <i class="fa fa-table"></i> </span>
                    <h2>在线统计</h2>
                </header>
                <div>
                    <div class="widget-body no-padding">
                        <div class="page-header clearfix s_table_opreation">
                            <div class="left page-header-btn">
                                <sa-company-tree-car companyTreeId="searchcompanyTree" tcarNumberSelect2="searchCarNumberSelect2" wrapId="content" [isShowCarSort]="false" [isShowCarNum]="false" (companySelected)="companySelected($event)"></sa-company-tree-car>
                                <div class="top_module">
                                    <span class="module_text">时间区间</span>
                                    <select class="module_inp" name="dateType" id="dateType" [(ngModel)]="dateType">
                                        <option value="">全部</option>
                                        <option value="2">今天</option>
                                        <option value="4">1-3天</option>
                                        <option value="5">3-5天</option>
                                        <option value="6">5-7天</option>
                                        <option value="7">7天以上</option>
                                    </select>
                                </div>
                                <button type="button" class="btn btn-primary" (click)="table_search()">查看</button>
                                <button type="button" class="btn btn-primary" (click)="exportData()">导出</button>
                            </div>
                        </div>
                        <div class="table_scroll">
                            <table class="display dataTables responsive table table-striped table-bordered table-hover dataTable s_h5_table">
                                <thead>
                                    <tr>
                                        <th>公司名称</th>
                                        <th>在线车辆
                                            <span class="sort-icon">
                                                <i class="fa  fa-caret-left" [ngClass]="{active:sortFlag == 1}" (click)="columnSort(1)"></i>
                                                <i class="fa  fa-caret-right" [ngClass]="{active:sortFlag == 2}" (click)="columnSort(2)"></i>
                                            </span>
                                        </th>
                                        <th>离线车辆
                                            <span class="sort-icon">
                                                <i class="fa  fa-caret-left" [ngClass]="{active:sortFlag == 3}" (click)="columnSort(3)"></i>
                                                <i class="fa  fa-caret-right" [ngClass]="{active:sortFlag == 4}" (click)="columnSort(4)"></i>
                                            </span>
                                        </th>
                                        <th>车辆总数</th>
                                        <th>在线率
                                            <span class="sort-icon">
                                                <i class="fa  fa-caret-left" [ngClass]="{active:sortFlag == 5}" (click)="columnSort(5)"></i>
                                                <i class="fa  fa-caret-right" [ngClass]="{active:sortFlag == 6}" (click)="columnSort(6)"></i>
                                            </span>
                                        </th>
                                        <th>离线率</th>
                                        <!-- 这里也根据权限 -->
                                        <th>操作</th>
                                    </tr>
                                </thead>
                                <tbody>
                                    <tr *ngFor="let row of tableData">
                                        <td>{{row.companyName}}</td>
                                        <td>{{row.onLineCount}}</td>
                                        <td>{{row.offLineCount}}</td>
                                        <td>{{row.totalCount}}</td>
                                        <td>{{row.onLineRate}}%</td>
                                        <td>{{row.offlineRate}}%</td>
                                        <td>
                                            <button type="button" (click)="goOfflineDetail(row)">离线明细</button>
                                        </td>
                                    </tr>
                                </tbody>
                            </table>
                        </div>
                        <div class="table-fix clearfix">
                            <paginator [totalRecords]="totalCounts" [rows]="pageSize" [currentPage]="curPage - 1" (onPageChange)="paginate($event)">
                            </paginator>
                            <button type="button" class="btn default refresh_btn" (click)="refresh()"><i class="fa fa-refresh"></i></button>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </sa-widgets-grid>
</div>